<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><#assign path="${request.getContextPath()}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="${path}/css/highlight.css" type="text/css" rel="stylesheet"/>
<script src="${path}/js/highlight.pack.js" type="text/javascript"></script>
<link href="${path}/css/blog.css" type="text/css" rel="stylesheet"/>
<title><@s.text name='search.key'/> <@s.text name='blog.title'/></title>
<link rel="short cut icon" HREF="${path}/images/favicon.ico" />
</head>
<script>
  hljs.tabReplace = '    ';
  hljs.initHighlightingOnLoad();
</script>
<body>
<div id="wrapper">
	<#include "/header.ftl" />
	<div id="content">
		
		<#if pager.rowCount gt 0>
			<#list pager.resultList as blogArticle>
			<div class="post">
				<h2 class="post-title"><a href="<@s.url action="articleDetail" namespace="/article" ><@s.param name="bid" value="${blogArticle.id}" /><@s.param name="pageNo" value="1" /></@s.url>" title="${blogArticle.article.title}"> ${blogArticle.article.title} </a></h2>
				<#assign articleDate = "${blogArticle.article.writeDate?string('yy-MM-dd')}" />
				<#assign articleDateFormart = "${articleDate?date('yy-MM-dd')}" />
				<p class="post-date">
					<span class="day">${articleDateFormart?split('-')[2]}</span> 
					<span class="month">${articleDateFormart?split('-')[1]}</span> 
					<span class="year">${articleDateFormart?split('-')[0]}</span> 
					<#if blogArticle.commentsCount gt 0><span class="postcomment">${blogArticle.commentsCount} comments</span><#else><span class="postcomment">No comment</span></#if>
				</p>
				<p class="post-data"><span class="postauthor">by ${blogArticle.article.author.userName}</span><span class="postcategory">in ${blogArticle.article.articleCategories.categoryName}</span> Tags: <#list blogArticle.article.keyWordSet as keyWord>${keyWord.name}</#list> </p>
				${blogArticle.article.articlePreView?default("")}
				<#if blogArticle.displayReadMore?string == "true">
					<a href='<@s.url action="articleDetail" namespace="/article" ><@s.param name="bid" value="${blogArticle.id}" /><@s.param name="pageNo" value="1" /></@s.url>' class="more-link" >More</a>
				</#if>
			</div>
			</#list>
		<#else>
			<h2>No Result Found</h2>
		</#if>
		<#assign action = "sptag" />
		<#assign namespace = "/article" />
		<#assign param = {"tag":"${searchStr}"}/>
		<#include "/pager.ftl" />
		<!--/post -->
	<!--	<p class="post-nav"><span class="previous">Pre</span> <span class="next">Next</span></p>  -->
	</div>
	<#include "/sideBar.html" />
	<#include "/footer.ftl" />
</div>	
</body>

</html>